package com.manage.func.activity.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.manage.base.dao.impl.BaseDaoImpl;
import com.manage.func.activity.dao.IActivityDao;
import com.manage.func.activity.model.ActExpireBean;
import com.manage.func.activity.model.ActivityBean;
import com.manage.func.activity.model.ActivityVsUserBean;

@Repository("activityDao")
public class ActivityDaoImpl extends BaseDaoImpl<ActivityBean>implements IActivityDao {

	@Override
	public List<ActivityBean> selectActivityList(ActivityBean bean) {
		return getSqlSession().selectList("ActivityMapper.selectActivityList", bean);
	}

	@Override
	public int insertActivity(ActivityBean queryBean) {
		return getSqlSession().insert("ActivityMapper.insertActivity", queryBean);
	}

	@Override
	public int updateActivity(ActivityBean queryBean) {
		return getSqlSession().update("ActivityMapper.updateActivity", queryBean);
	}

	@Override
	public int selectTotalCount(ActivityBean queryBean) {
		return getSqlSession().selectOne("ActivityMapper.selectTotalCount", queryBean);
	}

	@Override
	public int deleteActivity(ActivityBean queryBean) {
		return getSqlSession().delete("ActivityMapper.deleteActivity", queryBean);
	}

	@Override
	public List<ActivityVsUserBean> selectActivityUserList(ActivityBean queryBean) {
		return getSqlSession().selectList("ActivityMapper.selectActivityUserList", queryBean);
	}

	@Override
	public int selectActivityUserCount(ActivityBean queryBean) {
		return getSqlSession().selectOne("ActivityMapper.selectActivityUserCount", queryBean);
	}

	@Override
	public List<ActExpireBean> expireSelect() {
		return getSqlSession().selectList("expireActCheck");
	}

	@Override
	public int expireUpdate(ActExpireBean actExpireBean) {
		return getSqlSession().update("expireActUpdate", actExpireBean);
	}

	@Override
	public ActivityBean selectActivityById(ActivityBean bean) {
		return getSqlSession().selectOne("ActivityMapper.selectActivityById", bean);
	}

	@Override
	public List<ActivityBean> queryActListPushBean() {
		return getSqlSession().selectList("ActivityMapper.queryActListPushBean");
	}

	@Override
	public void updateActPushStatus(long activityId) {
		ActivityBean bean = new ActivityBean();
		bean.activityId = activityId;
		getSqlSession().update("ActivityMapper.updateActPushStatus", bean);
	}
}
